package com.shcz.migu.utils;

import java.text.DecimalFormat;

/**
 * Created by Sea Zhang on 2017/4/18.
 */

public class DoubleUtils {

    public static String formatDecimal(Double data) {
        DecimalFormat df = new DecimalFormat("######0.0");
        double f = data;
        int fi=(int)f;
        if(f==fi)
           return fi+"";
        else
        return df.format(data);
    }
    public static String formatInt(Double data) {
        DecimalFormat df = new DecimalFormat("######0");
        double f = data;
        int fi=(int)f;
            return fi+"";

    }

}
